package com.zhuojy.equity.mall.admin.web.controller.record;

import com.zhuojy.equity.mall.admin.common.entity.po.record.TRecordPO;
import com.zhuojy.equity.mall.admin.common.pojo.ResultEntity;
import com.zhuojy.equity.mall.admin.service.record.RecordService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author xrz
 * @version 1.0
 * @description:TODO
 * @date 2024/4/15 16:32
 */
@RestController
@RequiredArgsConstructor
@CrossOrigin
@RequestMapping("record")
public class RecordController {

    @Autowired
    private RecordService recordService;

    /**
     * 查询信息
     *
     * @param tCarMaintainPO
     * @param pageSize
     * @param pageNum
     * @return
     */
    @RequestMapping("findrecordPagination")
    private ResultEntity findrecordPagination(@RequestBody TRecordPO tCarMaintainPO, @RequestParam("pageSize") Integer pageSize, @RequestParam("pageNum") Integer pageNum) {
        return recordService.findrecordPagination(tCarMaintainPO, pageSize, pageNum);
    }

    /**
     * 添加信息
     *
     * @param tCarEtcConsumePO
     * @return
     */
    @RequestMapping("addrecord")
    private ResultEntity addrecord(@RequestBody TRecordPO tCarEtcConsumePO) {
        return recordService.addrecord(tCarEtcConsumePO);
    }

    /**
     * 修改信息
     *
     * @param tCarEtcConsumePO
     * @return
     */
    @RequestMapping("uprecord")
    private ResultEntity uprecord(@RequestBody TRecordPO tCarEtcConsumePO) {
        return recordService.uprecord(tCarEtcConsumePO);
    }

    /**
     * 回显信息
     *
     * @param id
     * @return
     */
    @RequestMapping("echorecord")
    private ResultEntity echorecord(@RequestParam("id") Integer id) {
        return recordService.echorecord(id);
    }

    /**
     * 删除信息
     *
     * @param id
     * @return
     */
    @RequestMapping("delrecord")
    private ResultEntity delrecord(@RequestParam("id") Integer id) {
        return recordService.delrecord(id);
    }

    /**
     * 查询指定信息
     * @return
     */
    @RequestMapping("findselect")
    private ResultEntity findselect(){
        return recordService.findselect();
    }
}
